package com.vcom.deploy.upgrade;

public enum AppEnum {

    APP_SMS("web", "s1--149.3--SMS_V1.0.0--sms.conf"),
    APP_SMS_SCREEN("screen", "s2--149.3--SMS_V1.0.0--screen.conf"),
    APP_SMS_JAVA("java", "s3--149.3--SMS_V1.0.0--shared_moped_supervisor_java.conf"),
    APP_SMS_OPENAPI("openapi", "s4--149.3--SMS_V1.0.0--shared_moped_supervisor_openapi.conf"),
    APP_SMS_BACKEND("backend", "s5--149.3--SMS_V1.0.0--shared_moped_supervisor_backend.conf"),

    NONE("", ""),
    ;

    private final String appCode;

    private final String scriptParams;

    AppEnum(String appCode, String scriptParams) {
        this.appCode = appCode;
        this.scriptParams = scriptParams;
    }

    public String getAppCode() {
        return appCode;
    }

    public String getScriptParams() {
        return scriptParams;
    }

    public static AppEnum getAppEnumBy(String appCode) {
        AppEnum[] values = AppEnum.values();
        for (AppEnum value : values) {
            if (value.getAppCode().equals(appCode)) {
                return value;
            }
        }
        return NONE;
    }

}